package com.javabasic.thread;

/**
 * @Author xiongmin
 * @Description //TODO
 * @Date 2020/6/8 0:02
 * @Version 1.0
 **/
public class SendMailThread extends Thread {

    private SendMail sendMail;


    public SendMailThread(SendMail sendMail) {
        this.sendMail = sendMail;
    }

    @Override
    public void run() {
        this.sendMail.executeSendMail();
        // TODO  辨别是否需要回调
        if (this.sendMail instanceof Callback) {
            ((Callback)this.sendMail).callBack();
        }
    }
}
